package com.janke.softballnexus.client.widgets;

import com.google.gwt.core.client.GWT;
import com.google.gwt.editor.client.Editor;
import com.google.gwt.editor.ui.client.ValueBoxEditorDecorator;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Focusable;
import com.google.gwt.user.client.ui.Widget;
import com.janke.softballnexus.shared.DivisionProxy;

public class DivisionEditor extends Composite implements Editor<DivisionProxy> {

	interface Binder extends UiBinder<Widget, DivisionEditor> {
	}

	@UiField
	ValueBoxEditorDecorator<String> name;

	@UiField
	ValueBoxEditorDecorator<Integer> year;

	@UiField
	ValueBoxEditorDecorator<Integer> minimumAge;

	@UiField
	ValueBoxEditorDecorator<Integer> maximumAge;

	@UiField
	Focusable nameBox;

	public DivisionEditor() {
		initWidget(GWT.<Binder> create(Binder.class).createAndBindUi(this));
	}

	public void focus() {
		nameBox.setFocus(true);
	}
}
